from selenium import webdriver

driver = webdriver.Chrome()

url = 'https://cn.bing.com/'
driver.get(url)

# 定位到输入框
el = driver.find_element_by_tag_name('input')
el.send_keys('美国')

# 定位到搜搜按钮
el_sub = driver.find_element_by_id('sb_form_go')
el.submit()

# 定位到所有搜索结果元素
results = driver.find_elements_by_css_selector('.b_algo>h2>a')
print(len(results))

for i in results:
    # 打印相关信息
    print(i.text,i.get_attribute('href'))
    print(i.size,i.is_displayed())

driver.close()